<!DOCTYPE html>
<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=0,minimum-scale=1.0,maximum-scale=1.0" />
    <meta name="author" content="火星科技 http://mars3d.cn " />
    <meta name="apple-touch-fullscreen" content="yes" />
    <meta name="apple-mobile-web-app-capable" content="yes" />
    <meta name="apple-mobile-web-app-status-bar-style" content="black" />
    <meta name="format-detection" content="telephone=no" />
    <meta name="x5-fullscreen" content="true" />
    <meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1" />
    <!-- 标题及搜索关键字 -->
    <meta name="keywords" content="火星科技,cesium,3D,GIS,marsgis,三维,地球,地图,开发,框架,系统,示例,资料,模型,离线,外包,合肥,安徽,中国" />
    <meta
      name="description"
      content="火星科技 合肥火星 合肥火星科技 合肥火星科技有限公司 leaflet leaflet框架 leaflet开发 cesium cesium开发 cesium框架 三维 地球 模型  gis marsgis 地图离线 地图开发 地图框架 地图外包 框架 开发 外包  地图离线 二维地图 三维地图 全景漫游 地理信息系统 云GIS 三维GIS GIS平台 WebGIS"
    />

    <link rel="shortcut icon" type="image/x-icon" href="/img/favicon/favicon.ico" />
    <title>民航航线(OD线) | Mars3D | 三维地图 | 火星科技 | 合肥火星科技有限公司</title>

    <!--第三方lib-->
    <script
      type="text/javascript"
      src="/lib/include-lib.js"
      libpath="/lib/"
      include="jquery,layer,echarts,toastr,font-awesome,bootstrap,layer,haoutil,mars3d"
    ></script>

    <link href="/css/style.css" rel="stylesheet" />
    <style>
      .chartOne,
      .chartTwo,
      .chartThree {
        width: 100%;
        height: 300px;
        margin-bottom: 20px;
        position: relative;
        border: 1px solid #17366c;
        background: linear-gradient(to left, #3897cf, #3897cf) left top no-repeat, linear-gradient(to bottom, #3897cf, #3897cf) left top no-repeat,
          linear-gradient(to left, #3897cf, #3897cf) right top no-repeat, linear-gradient(to bottom, #3897cf, #3897cf) right top no-repeat,
          linear-gradient(to left, #3897cf, #3897cf) left bottom no-repeat, linear-gradient(to bottom, #3897cf, #3897cf) left bottom no-repeat,
          linear-gradient(to left, #3897cf, #3897cf) right bottom no-repeat, linear-gradient(to left, #3897cf, #3897cf) right bottom no-repeat;
        background-size: 1px 20px, 20px 1px, 1px 20px, 20px 1px;
        background-color: rgba(0, 0, 0, 0.1);
      }

      .chartOne h6 {
        margin-top: 5px;
        width: 10px;
        height: 5px;
        color: white;
      }

      .chartTwo h6 {
        margin-top: 5px;
        width: 10px;
        height: 5px;
        color: white;
      }
      .chartThree h6 {
        margin-top: 5px;
        width: 10px;
        height: 5px;
        color: white;
      }

      .chartTwo_ulgnhx,
      .chartThree_ulhbtj {
        width: 84%;
        height: 90%;
        position: absolute;
        left: 8%;
        bottom: 5px;
      }

      .chartTwo {
        height: 300px;
        width: 100%;
      }

      .chartOne {
        height: 96px;
      }

      .echarts_HX {
        width: 360px;
      }

      .hx ._item_row {
        display: flex;
        align-items: center;
        flex-wrap: wrap;
        text-align: left;
        position: relative;
        left: 72px;
        bottom: 25px;
      }
      ._item_full_box_width {
        width: 100%;
      }

      .right_title {
        font-size: 1.4rem;
        font-weight: bold;
        color: #febc04;
        line-height: 3rem;
        background: linear-gradient(180deg, #e5be38 0%, #ff882e 100%);
        -webkit-background-clip: text;
        white-space: nowrap;
        -webkit-text-fill-color: transparent;
        font-family: "UnidreamLED", "Helvetica Neue", Helvetica, Arial, sans-serif;
      }
      .right_sub_title {
        font-size: 0.85rem;
        color: #d8d8d8;
        line-height: 1;
        white-space: nowrap;
        background: linear-gradient(180deg, #e5be38 0%, #ff882e 100%);
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
      }

      .row1_right {
        margin-left: 0.6rem;
        text-align: left;
      }
      .row1 {
        align-items: center;
        display: flex;
        margin-bottom: 1.15rem;
      }
      .icon {
        margin-left: 28px;
      }
      h6 {
        margin-left: 10px;
      }
    </style>
  </head>

  <body class="dark">
    <div id="mars3dContainer" class="mars3d-container"></div>

    <div id="echartsPannel" class="infoview echarts_HX">
      <div class="chartOne" id="chartOne">
        <h6>航线条数</h6>

        <div class="hx">
          <div class="_item_row _item_full_box_width justify-between">
            <div>
              <mars-icon icon="airplane" :width="30" class="icon" />
              <div class="row1_right">
                <div class="right_title" id="guoneiLine"></div>
                <div class="right_sub_title">国内航班</div>
              </div>
            </div>

            <div>
              <mars-icon icon="take-off" :width="35" class="icon" />
              <airplane theme="outline" size="43" fill="#333" />
              <div class="row1_right">
                <div class="right_title" id="guojiLine"></div>
                <div class="right_sub_title">国际航班</div>
              </div>
            </div>
          </div>
        </div>
      </div>

      <div class="chartTwo" id="chartTwo">
        <h6>国内机场航线数</h6>
        <div id="ul_GNHX" class="chartTwo_ulgnhx"></div>
      </div>
      <div class="chartThree" id="chartThree">
        <h6>年度航班统计</h6>
        <div id="ul_HBTJ" class="chartThree_ulhbtj"></div>
      </div>
    </div>

    <script src="/js/common.js"></script>
    <script src="./map.js"></script>
    <script type="text/javascript">
      "use script" //开发环境建议开启严格模式

      let GNHX
      let HBTJ

      let route = [] // 国内机场航线数据
      let flight = []

      function initUI() {
        const airData = getAirData()
        GNHX = document.getElementById("ul_GNHX")
        HBTJ = document.getElementById("ul_HBTJ")

        let guonei = airData.guonei
        let guoji = airData.guoji
        $("#guoneiLine").text(guonei + "(条)")
        $("#guojiLine").text(guoji + "(条)")

        route = airData.route
        flight = airData.flight

        initCharts_Two()
        initCharts_Three()
      }

      function initCharts_Two() {
        const airportData = [] // 机场数据
        route.forEach((item) => {
          airportData.push({
            name: item.airport,
            value: item.routeNum
          })
        })

        console.log("---", GNHX)

        const myChart = echarts.init(GNHX)
        const option = {
          tooltip: {
            trigger: "item",
            formatter: "机场名：{b}<br/> 航线：{c}"
          },
          // legend: {
          //   orient: "horizontal",
          //   top: "0.1%",
          //   textStyle: {
          //     color: "#ffffff"
          //   }
          // },
          series: [
            {
              type: "pie",
              radius: "50%",
              label: {
                show: true
              },

              data: airportData
            }
          ]
        }
        myChart.setOption(option)
      }

      function initCharts_Three() {
        const year = []
        const domestic = [] // 国内航班
        const international = [] // 国际航班

        flight.forEach((item) => {
          year.push(item.year)
          domestic.push(item.domestic)
          international.push(item.international)
        })

        const myChart = echarts.init(HBTJ)

        const option = {
          tooltip: {
            trigger: "axis",
            axisPointer: {
              type: "shadow"
            }
          },
          grid: {
            left: "8%",
            right: "0%",
            bottom: "6%",
            containLabel: true
          },
          xAxis: [
            {
              type: "category",
              data: year,
              axisTick: {
                alignWithLabel: true
              }
            }
          ],
          yAxis: [
            {
              type: "value"
            }
          ],
          series: [
            {
              name: "国内航班",
              type: "bar",
              barWidth: "30%",
              data: domestic
            },
            {
              name: "国际航班",
              type: "bar",
              barWidth: "30%",
              data: international
            }
          ]
        }

        myChart.setOption(option)

        window.addEventListener("resize", function () {
          myChart.resize()
        })
      }
    </script>
  </body>
</html>
